<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>旅游攻略 - 汉中旅游</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="css/style.css">
    <style>
        /* 新增样式 */
        .page-header {
            background: linear-gradient(rgba(193, 44, 44, 0.8), rgba(139, 0, 0, 0.8)), url('img/header-bg.jpg');
            background-size: cover;
            background-position: center;
            color: white;
            padding: 100px 0;
            text-align: center;
            margin-bottom: 50px;
        }

        .page-header h1 {
            font-size: 3em;
            margin-bottom: 20px;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
        }

        .page-header p {
            font-size: 1.2em;
            max-width: 600px;
            margin: 0 auto;
        }

        .category-nav {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 20px;
            margin: 40px 0;
        }

        .category-link {
            background: white;
            padding: 30px 20px;
            border-radius: 10px;
            text-align: center;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            transition: transform 0.3s ease;
            text-decoration: none;
            color: inherit;
        }

        .category-link:hover {
            transform: translateY(-5px);
        }

        .category-icon {
            font-size: 2em;
            margin-bottom: 15px;
            color: #DC4E42;
        }

        .section-padding {
            padding: 60px 0;
        }

        .section-title {
            text-align: center;
            font-size: 2.5em;
            margin-bottom: 40px;
            position: relative;
            padding-bottom: 20px;
        }

        .section-title::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 80px;
            height: 3px;
            background: #DC4E42;
        }

        .guide-section {
            background: white;
            border-radius: 15px;
            padding: 30px;
            margin-bottom: 30px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }

        .guide-section h3 {
            color: #DC4E42;
            margin-bottom: 20px;
            font-size: 1.5em;
        }

        .info-box {
            background: #f8f9fa;
            padding: 20px;
            border-radius: 10px;
            margin-top: 20px;
        }

        .accommodation-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 30px;
        }

        .accommodation-item {
            background: white;
            border-radius: 15px;
            overflow: hidden;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }

        .accommodation-image {
            height: 250px;
            overflow: hidden;
        }

        .accommodation-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .accommodation-content {
            padding: 25px;
        }

        .accommodation-meta {
            display: flex;
            gap: 20px;
            margin: 15px 0;
            color: #666;
        }

        .tips-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 30px;
        }

        .tip-item {
            background: white;
            padding: 30px;
            border-radius: 15px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }

        .tip-icon {
            font-size: 2em;
            color: #DC4E42;
            margin-bottom: 20px;
        }

        .season-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 30px;
        }

        .season-item {
            background: white;
            border-radius: 15px;
            overflow: hidden;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }

        .season-image {
            height: 300px;
            position: relative;
        }

        .season-image img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .season-tag {
            position: absolute;
            top: 20px;
            right: 20px;
            background: #DC4E42;
            color: white;
            padding: 5px 15px;
            border-radius: 20px;
        }

        .season-content {
            padding: 25px;
        }

        .season-features {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 15px;
            margin-top: 20px;
        }

        .feature {
            text-align: center;
        }

        .feature-name {
            display: block;
            color: #666;
            margin-bottom: 5px;
        }

        .feature-value {
            color: #DC4E42;
            font-weight: bold;
        }

        footer {
            background: #2c3e50;
            color: white;
            padding: 60px 0 0;
        }

        .footer-content {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 40px;
        }

        .footer-section h3 {
            margin-bottom: 20px;
            font-size: 1.2em;
        }

        .footer-section ul {
            list-style: none;
            padding: 0;
        }

        .footer-section ul li {
            margin-bottom: 10px;
        }

        .footer-section a {
            color: #ecf0f1;
            text-decoration: none;
        }

        .social-links {
            display: flex;
            gap: 15px;
            margin-top: 20px;
        }

        .social-links a {
            color: white;
            font-size: 1.5em;
        }

        .footer-bottom {
            background: #1a252f;
            padding: 20px 0;
            margin-top: 40px;
            text-align: center;
        }

        @media (max-width: 768px) {
            .category-nav,
            .accommodation-grid,
            .tips-grid,
            .season-grid,
            .footer-content {
                grid-template-columns: 1fr;
            }
        }

        /* 旅游攻略页面特定样式 */
    </style>
</head>
<body>
    <!-- 页面加载动画 -->
    <div class="page-loader">
        <div class="loader"></div>
    </div>
    
    <!-- 顶部快速导航栏 -->
    <div class="top-quick-nav" style="background-color: #DC4E42; display: flex; align-items: center; justify-content: center; padding: 0 50px;">
        <div class="quick-nav-container">
            <ul style="display: flex; align-items: center;">
                <li style="display: flex; align-items: center; margin-right: 0;">
                    <img src="img/attractions/logo.jpg" alt="汉中旅游" style="height: 40px; border-radius: 5px; margin-right: 10px;">
                </li>
                <li><a href="index.html">首页</a></li>
                <li><a href="jingdian.html">景点介绍</a></li>
                <li><a href="luxian.html">旅游线路</a></li>
                <li><a href="gonglue.html" class="active">旅游攻略</a></li>
                <li><a href="meishi.html">美食推荐</a></li>
                <li><a href="wenhua.html">汉文化活动</a></li>
                <li><a href="contact.html">联系我们</a></li>
                <li><a href="faq.html">常见问题</a></li>
            </ul>
        </div>
    </div>
    
    <!-- 浮动导航菜单 -->
    <div class="float-nav">
        <button class="float-nav-toggle" id="floatNavToggle" title="快速导航">
            <i class="fas fa-bars"></i>
        </button>
        <div class="float-nav-menu" id="floatNavMenu">
            <ul>
                <li><a href="index.html">首页</a></li>
                <li><a href="jingdian.html">景点介绍</a></li>
                <li><a href="luxian.html">旅游线路</a></li>
                <li><a href="gonglue.html" class="active">旅游攻略</a></li>
                <li><a href="meishi.html">美食推荐</a></li>
                <li><a href="wenhua.html">汉文化活动</a></li>
                <li><a href="contact.html">联系我们</a></li>
                <li><a href="faq.html">常见问题</a></li>
            </ul>
        </div>
    </div>
    


    <!-- 导航栏 -->
    <nav>
        <div class="container">
            <div class="nav-container">
                <div class="nav-logo">
                    <img src="img/attractions/logo.jpg" alt="汉中旅游" style="height: 45px; border-radius: 5px; margin-right: 10px;">
                    <h2 style="color: #ffffff; font-weight: bold;">汉中旅游</h2>
                </div>
                <ul class="main-nav">
                    <li><a href="index.html">首页</a></li>
                    <li class="dropdown">
                        <a href="jingdian.html">景点介绍</a>
                        <div class="dropdown-content">
                            <a href="jingdian.html#natural">自然风光</a>
                            <a href="jingdian.html#historical">历史古迹</a>
                            <a href="jingdian.html#cultural">文化景观</a>
                        </div>
                    </li>
                    <li class="dropdown">
                        <a href="luxian.html">旅游线路</a>
                        <div class="dropdown-content">
                            <a href="luxian.html#oneday">一日游</a>
                            <a href="luxian.html#threedays">三日游</a>
                            <a href="luxian.html#fivedays">五日游</a>
                        </div>
                    </li>
                    <li class="dropdown">
                        <a href="gonglue.html" class="active">旅游攻略</a>
                        <div class="dropdown-content">
                            <a href="#transportation">交通指南</a>
                            <a href="#accommodation">住宿推荐</a>
                            <a href="#tips">注意事项</a>
                            <a href="#besttime">最佳旅游时间</a>
                        </div>
                    </li>
                    <li><a href="meishi.html">美食推荐</a></li>
                    <li><a href="wenhua.html">汉文化活动</a></li>
                    <li><a href="contact.html">联系我们</a></li>
                    <li><a href="faq.html">常见问题</a></li>
                </ul>
            </div>
        </div>
    </nav>

    <!-- 主要内容 -->
    <main>
        <!-- 页面标题 -->
        <section class="page-header">
            <div class="container">
                <h1>汉中旅游攻略</h1>
                <p>让您的汉中之行更加便捷、愉快</p>
            </div>
        </section>

        <!-- 攻略分类导航 -->
        <section class="container">
            <div class="category-nav">
                <a href="#transportation" class="category-link">
                    <div class="category-icon"><i class="fas fa-plane"></i></div>
                    <span>交通指南</span>
                </a>
                <a href="#accommodation" class="category-link">
                    <div class="category-icon"><i class="fas fa-bed"></i></div>
                    <span>住宿推荐</span>
                </a>
                <a href="#tips" class="category-link">
                    <div class="category-icon"><i class="fas fa-exclamation-circle"></i></div>
                    <span>注意事项</span>
                </a>
                <a href="#besttime" class="category-link">
                    <div class="category-icon"><i class="fas fa-calendar-alt"></i></div>
                    <span>最佳旅游时间</span>
                </a>
            </div>
        </section>

        <!-- 交通指南 -->
        <section id="transportation" class="container section-padding">
            <h2 class="section-title">交通指南</h2>
            
            <div class="guide-section">
                <h3><i class="fas fa-plane"></i> 航空</h3>
                <div class="guide-content">
                    <p>汉中西关机场位于汉中市区西部，距市中心约10公里。目前开通了汉中至西安、北京、上海、广州、成都等航线。</p>
                    <div class="info-box">
                        <h4>机场交通</h4>
                        <p>机场巴士：机场至市区有专线巴士，票价约15元/人。</p>
                        <p>出租车：机场至市区约30元左右。</p>
                    </div>
                </div>
            </div>
            
            <div class="guide-section">
                <h3><i class="fas fa-train"></i> 铁路</h3>
                <div class="guide-content">
                    <p>汉中是西成高铁和西汉高铁的重要站点，交通十分便捷。</p>
                    <ul class="feature-list">
                        <li>西成高铁：连接西安和成都，途经汉中，从西安到汉中仅需1小时左右。</li>
                        <li>西汉高铁：连接西安和汉中，是陕西南北交通的重要通道。</li>
                    </ul>
                    <div class="info-box">
                        <h4>火车站交通</h4>
                        <p>公交：1路、5路、9路等多路公交车可到达市区主要地点。</p>
                        <p>出租车：火车站至市中心约15元左右。</p>
                    </div>
                </div>
            </div>
            
            <div class="guide-section">
                <h3><i class="fas fa-bus"></i> 公路</h3>
                <div class="guide-content">
                    <p>汉中有多条高速公路连接周边城市，交通网络发达。</p>
                    <ul class="feature-list">
                        <li>十天高速：连接十堰和天水，途经汉中。</li>
                        <li>西汉高速：连接西安和汉中。</li>
                        <li>汉巴高速：连接汉中和巴中。</li>
                    </ul>
                    <div class="info-box">
                        <h4>汽车站信息</h4>
                        <p>汉中汽车站：位于市中心，有发往周边县市及外省市的班车。</p>
                        <p>汉中客运中心：位于市区东部，主要发往西安、成都等大城市的班车。</p>
                    </div>
                </div>
            </div>
            
            <div class="guide-section">
                <h3><i class="fas fa-car"></i> 市内交通</h3>
                <div class="guide-content">
                    <p>汉中市区不大，交通比较便利，主要有以下几种出行方式：</p>
                    <ul class="feature-list">
                        <li>公交车：市内有多条公交线路，票价1-2元，覆盖主要景点和商业区。</li>
                        <li>出租车：起步价6元（3公里），之后每公里1.6元。</li>
                        <li>共享单车：市区内有多家共享单车品牌，方便短途出行。</li>
                        <li>包车：适合团队或家庭游，可联系当地旅行社安排。</li>
                    </ul>
                </div>
            </div>
        </section>

        <!-- 住宿推荐 -->
        <section id="accommodation" class="container section-padding">
            <h2 class="section-title">住宿推荐</h2>
            
            <div class="accommodation-grid">
                <div class="accommodation-item">
                    <div class="accommodation-image">
                        <img src="img/attractions/jinjiang1.jpg" alt="汉中金江大酒店">
                    </div>
                    <div class="accommodation-content">
                        <h3>汉中金江大酒店</h3>
                        <div class="accommodation-meta">
                            <span><i class="fas fa-map-marker-alt"></i> 汉台区民主街中段</span>
                            <span><i class="fas fa-star"></i> 四星级</span>
                        </div>
                        <p>汉中金江大酒店位于市中心，交通便利，周边商业设施完善，是商务和旅游的理想选择。</p>
                        <div class="accommodation-info">
                            <p><strong>价格区间：</strong> 300-600元/晚</p>
                            <p><strong>特色设施：</strong> 餐厅、会议室、健身房、免费WiFi</p>
                            <p><strong>周边景点：</strong> 汉中古城墙、南湖公园</p>
                        </div>
                    </div>
                </div>
                
                <div class="accommodation-item">
                    <div class="accommodation-image">
                        <img src="img/attractions/rongjia1.jpg" alt="荣嘉国际酒店">
                    </div>
                    <div class="accommodation-content">
                        <h3>荣嘉国际酒店</h3>
                        <div class="accommodation-meta">
                            <span><i class="fas fa-map-marker-alt"></i> 汉台区滨江路</span>
                            <span><i class="fas fa-star"></i> 三星级</span>
                        </div>
                        <p>汉中荣嘉国际酒店环境优美，临近嘉陵江，房间宽敞明亮，服务热情周到。</p>
                        <div class="accommodation-info">
                            <p><strong>价格区间：</strong> 200-400元/晚</p>
                            <p><strong>特色设施：</strong> 中餐厅、停车场、商务中心</p>
                            <p><strong>周边景点：</strong> 嘉陵江风光带</p>
                        </div>
                    </div>
                </div>
                
                <div class="accommodation-item">
                    <div class="accommodation-image">
                        <img src="img/attractions/qingnian.jpg" alt="汉中古城青年旅舍">
                    </div>
                    <div class="accommodation-content">
                        <h3>汉中古城青年旅舍</h3>
                        <div class="accommodation-meta">
                            <span><i class="fas fa-map-marker-alt"></i> 汉台区古城内</span>
                            <span><i class="fas fa-star"></i> 经济型</span>
                        </div>
                        <p>位于汉中古城内的特色青年旅舍，环境温馨，价格实惠，适合背包客和年轻旅行者。</p>
                        <div class="accommodation-info">
                            <p><strong>价格区间：</strong> 60-150元/晚</p>
                            <p><strong>特色设施：</strong> 公共厨房、休闲区、自助洗衣</p>
                            <p><strong>周边景点：</strong> 古城墙、汉中博物馆</p>
                        </div>
                    </div>
                </div>
                
                <div class="accommodation-item">
                    <div class="accommodation-image">
                        <img src="img/attractions/youmanji.jpg" alt="武侯山庄">
                    </div>
                    <div class="accommodation-content">
                        <h3>武侯山庄</h3>
                        <div class="accommodation-meta">
                            <span><i class="fas fa-map-marker-alt"></i> 勉县武侯墓景区附近</span>
                            <span><i class="fas fa-star"></i> 特色民宿</span>
                        </div>
                        <p>武侯山庄是一家具有三国文化特色的民宿，距离武侯墓景区仅500米，环境幽静，服务周到。</p>
                        <div class="accommodation-info">
                            <p><strong>价格区间：</strong> 180-380元/晚</p>
                            <p><strong>特色设施：</strong> 三国主题房间、农家餐厅、免费停车</p>
                            <p><strong>周边景点：</strong> 武侯墓、定军山</p>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- 注意事项 -->
        <section id="tips" class="container section-padding">
            <h2 class="section-title">注意事项</h2>
            
            <div class="tips-grid">
                <div class="tip-item">
                    <div class="tip-icon"><i class="fas fa-umbrella"></i></div>
                    <h3>天气与装备</h3>
                    <ul class="tip-list">
                        <li>汉中夏季炎热多雨，请带好雨具和防晒用品。</li>
                        <li>冬季温差较大，建议携带保暖衣物。</li>
                        <li>山区游玩请穿着舒适的运动鞋，并准备防蚊虫药物。</li>
                    </ul>
                </div>
                
                <div class="tip-item">
                    <div class="tip-icon"><i class="fas fa-money-bill-wave"></i></div>
                    <h3>消费与支付</h3>
                    <ul class="tip-list">
                        <li>汉中消费水平适中，主要景点门票在40-80元之间。</li>
                        <li>市区内大多商家支持移动支付，但乡村地区建议准备适量现金。</li>
                        <li>部分景区内餐饮价格偏高，可适当准备零食。</li>
                    </ul>
                </div>
                
                <div class="tip-item">
                    <div class="tip-icon"><i class="fas fa-map-marked-alt"></i></div>
                    <h3>出行建议</h3>
                    <ul class="tip-list">
                        <li>景点之间距离较远，建议合理规划行程。</li>
                        <li>自驾游可以更灵活地安排行程，但山区道路较为复杂，请注意安全。</li>
                        <li>节假日期间景点人流量大，建议提前预订酒店和门票。</li>
                    </ul>
                </div>
                
                <div class="tip-item">
                    <div class="tip-icon"><i class="fas fa-utensils"></i></div>
                    <h3>饮食安全</h3>
                    <ul class="tip-list">
                        <li>品尝当地美食时注意卫生，选择人流量大的餐厅。</li>
                        <li>汉中菜口味偏辣，不习惯辛辣的游客可以提前告知商家。</li>
                        <li>饮用水建议购买瓶装水，不建议直接饮用自来水。</li>
                    </ul>
                </div>
            </div>
        </section>

        <!-- 最佳旅游时间 -->
        <section id="besttime" class="container section-padding">
            <h2 class="section-title">最佳旅游时间</h2>
            
            <div class="season-grid">
                <div class="season-item">
                    <div class="season-image">
                        <img src="img/attractions/chunji.jpg" alt="春季">
                        <div class="season-tag">推荐</div>
                    </div>
                    <div class="season-content">
                        <h3>春季（3-5月）</h3>
                        <p>春季是汉中的踏青赏花季节，气温适宜，雨量适中。这个时候可以欣赏到城市公园和山区的各种花卉盛开，特别是南湖公园的樱花和牡丹非常美丽。</p>
                        <div class="season-features">
                            <div class="feature">
                                <span class="feature-name">平均气温</span>
                                <span class="feature-value">12-22°C</span>
                            </div>
                            <div class="feature">
                                <span class="feature-name">适合景点</span>
                                <span class="feature-value">南湖公园、天台山、褒河风景区</span>
                            </div>
                            <div class="feature">
                                <span class="feature-name">特色活动</span>
                                <span class="feature-value">汉中油菜花节、茶文化节</span>
                            </div>
                        </div>
                    </div>
                </div>
                
                <div class="season-item">
                    <div class="season-image">
                        <img src="img/attractions/xiaji.jpg" alt="夏季">
                    </div>
                    <div class="season-content">
                        <h3>夏季（6-8月）</h3>
                        <p>夏季的汉中气温较高，但山区温度适宜，是避暑的好去处。这个季节适合参加水上活动和山地探险，褒河漂流和天台山避暑是不错的选择。</p>
                        <div class="season-features">
                            <div class="feature">
                                <span class="feature-name">平均气温</span>
                                <span class="feature-value">25-32°C</span>
                            </div>
                            <div class="feature">
                                <span class="feature-name">适合景点</span>
                                <span class="feature-value">褒河漂流、天台山、留坝青木川</span>
                            </div>
                            <div class="feature">
                                <span class="feature-name">特色活动</span>
                                <span class="feature-value">汉中避暑节、水上嘉年华</span>
                            </div>
                        </div>
                    </div>
                </div>
                
                <div class="season-item">
                    <div class="season-image">
                        <img src="img/attractions/qiuji.jpg" alt="秋季">
                        <div class="season-tag">推荐</div>
                    </div>
                    <div class="season-content">
                        <h3>秋季（9-11月）</h3>
                        <p>秋季是汉中最美的季节之一，天高气爽，山林染上金黄和红色。这个时候适合登山和观赏秋色，也是品尝当地特色农产品的好时机。</p>
                        <div class="season-features">
                            <div class="feature">
                                <span class="feature-name">平均气温</span>
                                <span class="feature-value">15-25°C</span>
                            </div>
                            <div class="feature">
                                <span class="feature-name">适合景点</span>
                                <span class="feature-value">定军山、武侯墓、城固五柳湖</span>
                            </div>
                            <div class="feature">
                                <span class="feature-name">特色活动</span>
                                <span class="feature-value">汉中农民丰收节、武侯文化节</span>
                            </div>
                        </div>
                    </div>
                </div>
                
                <div class="season-item">
                    <div class="season-image">
                        <img src="img/attractions/dongji.jpg" alt="冬季">
                    </div>
                    <div class="season-content">
                        <h3>冬季（12-2月）</h3>
                        <p>冬季的汉中较为寒冷，但相比北方城市要温和许多。这个季节游客较少，可以更加从容地游览历史古迹，也有机会欣赏到雪后的美景。</p>
                        <div class="season-features">
                            <div class="feature">
                                <span class="feature-name">平均气温</span>
                                <span class="feature-value">2-10°C</span>
                            </div>
                            <div class="feature">
                                <span class="feature-name">适合景点</span>
                                <span class="feature-value">汉中博物馆、古城墙、南湖公园</span>
                            </div>
                            <div class="feature">
                                <span class="feature-name">特色活动</span>
                                <span class="feature-value">汉中年货节、冬季温泉养生</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </main>

    <!-- 页脚 -->
    <footer>
        <div class="container">
            <div class="footer-content">
                <div class="footer-section">
                    <h3>关于我们</h3>
                    <p>汉中旅游网致力于为游客提供最全面的汉中旅游信息，让您的汉中之行更加便捷、愉快。</p>
                    <div class="social-links">
                        <a href="#"><i class="fab fa-weibo"></i></a>
                        <a href="#"><i class="fab fa-weixin"></i></a>
                        <a href="#"><i class="fab fa-qq"></i></a>
                    </div>
                </div>
                <div class="footer-section">
                    <h3>快速链接</h3>
                    <ul>
                        <li><a href="index.html">首页</a></li>
                        <li><a href="jingdian.html">景点介绍</a></li>
                        <li><a href="luxian.html">旅游线路</a></li>
                        <li><a href="gonglue.html">旅游攻略</a></li>
                        <li><a href="contact.html">联系我们</a></li>
                    </ul>
                </div>
                <div class="footer-section">
                    <h3>热门景点</h3>
                    <ul>
                        <li><a href="jingdian.html#wuhoumu">武侯墓</a></li>
                        <li><a href="jingdian.html#nanhu">南湖</a></li>
                        <li><a href="jingdian.html#dingjunshan">定军山</a></li>
                        <li><a href="jingdian.html#guchengqiang">古城墙</a></li>
                    </ul>
                </div>
                <div class="footer-section">
                    <h3>联系方式</h3>
                    <p><i class="fas fa-map-marker-alt"></i> 地址：陕西省汉中市</p>
                    <p><i class="fas fa-phone"></i> 电话：0916-123456</p>
                    <p><i class="fas fa-envelope"></i> 邮箱：info@hanzhong-tourism.com</p>
                </div>
            </div>
        </div>
        <div class="footer-bottom">
            <div class="container">
                <p>&copy; 2023 汉中旅游网 版权所有</p>
            </div>
        </div>
    </footer>

    <script src="js/script.js"></script>

    <!-- 添加平滑滚动脚本 -->
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // 获取所有锚点链接
            const anchorLinks = document.querySelectorAll('a[href^="#"]');
            
            // 为每个锚点链接添加点击事件
            anchorLinks.forEach(function(link) {
                link.addEventListener('click', function(e) {
                    e.preventDefault();
                    
                    // 获取目标元素的ID
                    const targetId = this.getAttribute('href');
                    
                    // 如果是空锚点或者页面顶部，直接滚动到顶部
                    if (targetId === '#' || targetId === '') {
                        window.scrollTo({
                            top: 0,
                            behavior: 'smooth'
                        });
                        return;
                    }
                    
                    // 获取目标元素
                    const targetElement = document.querySelector(targetId);
                    
                    // 如果目标元素存在，滚动到该元素
                    if (targetElement) {
                        // 获取元素的位置
                        const elementPosition = targetElement.getBoundingClientRect().top;
                        const offsetPosition = elementPosition + window.pageYOffset - 100; // 减去100px的偏移量，避免被导航栏遮挡
                        
                        // 平滑滚动到目标位置
                        window.scrollTo({
                            top: offsetPosition,
                            behavior: 'smooth'
                        });
                    }
                });
            });
        });
    </script>
</body>
</html> 